package com.example.mengtianspringboot.Serice.impl;

import com.example.mengtianspringboot.Mapper.StudentMapper;
import com.example.mengtianspringboot.Pojo.Student;
import com.example.mengtianspringboot.Serice.StudentService;
import com.example.mengtianspringboot.utils.Md5Util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 功能
 * 作者：梦天
 * 日期：2023/11/18 15:01
 */
@Service
public class StudentServiceImpl implements StudentService {

    @Autowired
    private StudentMapper studentMapper;
    @Override
    public Student findByStudentName(String username) {
        Student student = studentMapper.findByStudentName(username);
        return student;
    }

    @Override
    public void register(String username, String password) {
        //加密，添加
        String md5Sting = Md5Util.getMD5String(password);
        System.out.println(md5Sting);
        studentMapper.add(username,md5Sting);
    }
}
